/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pojo;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;

/**
 *
 * @author pvhuy
 */
@Entity
@Table(name=DonDatHang.TABLE_DONDATHANG)
public class DonDatHang extends Base{
    public static final String TABLE_DONDATHANG = "DonDatHang";

    protected static final String COLUMN_TONGGIATRI = "TongGiaTri";
    @Column(name=COLUMN_TONGGIATRI)
    private float tongGiaTri;

    protected static final String COLUMN_NGAYDAT = "NgayDatHang";
    @Column(name=COLUMN_NGAYDAT)
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date ngayDatHang;

    protected static final String COLUMN_KHACHHANG = "MaKhachHang";
    @ManyToOne(cascade=CascadeType.ALL)
    @JoinColumn(name=COLUMN_KHACHHANG)
    private KhachHang khachHang;

    protected static final String COLUMN_HINHTHUCTHANHTOAN = "MaHinhThucThanhToan";
    //@ManyToOne(cascade=CascadeType.ALL)
    @ManyToOne
    @JoinColumn(name=COLUMN_HINHTHUCTHANHTOAN)
    private HinhThucThanhToan hinhThucThanhToan;

    protected static final String COLUMN_LOAITIEN = "MaLoaiTien";
    //@ManyToOne(cascade=CascadeType.ALL)
    @ManyToOne
    @JoinColumn(name=COLUMN_LOAITIEN)
    private LoaiTien loaiTien;

    protected static final String COLUMN_TINHTRANG = "MaTinhTrang";
    //@ManyToOne(cascade=CascadeType.ALL)
    @ManyToOne
    @JoinColumn(name=COLUMN_TINHTRANG)
    private TinhTrangDonHang tinhTrang;

    protected static final String COLUMN_THONGTINTUYCHON = "MaThongTinTuyChon";
    @OneToOne(cascade=CascadeType.ALL)
    @JoinColumn(name=COLUMN_THONGTINTUYCHON)
    private ThongTinTuyChon thongTinTuyChon;

    protected static final String COLUMN_HINHTHUCVANCHUYEN = "MaHinhThucVanChuyen";
    @ManyToOne(cascade=CascadeType.ALL)
    @JoinColumn(name=COLUMN_HINHTHUCVANCHUYEN)
    private HinhThucVanChuyen hinhThucVanChuyen;

    protected static final String COLUMN_THONGTINHOADON = "MaThongTinHoaDon";
    @OneToOne(cascade=CascadeType.ALL)
    @JoinColumn(name=COLUMN_THONGTINHOADON)
    private ThongTinHoaDon thongTinHoaDon;

    @OneToMany(mappedBy="donDatHang", cascade=CascadeType.ALL)
    private List<ChiTietDonDatHang> danhSachChiTietDonDatHang;

    /**
     * @return the tongGiaTri
     */
    public float getTongGiaTri() {
        return tongGiaTri;
    }

    /**
     * @param tongGiaTri the tongGiaTri to set
     */
    public void setTongGiaTri(float tongGiaTri) {
        this.tongGiaTri = tongGiaTri;
    }

    /**
     * @return the ngayDat
     */
    public Date getNgayDatHang() {
        return ngayDatHang;
    }

    /**
     * @param ngayDat the ngayDat to set
     */
    public void setNgayDatHang(Date ngayDatHang) {
        this.ngayDatHang = ngayDatHang;
    }

    /**
     * @return the khachHang
     */
    public KhachHang getKhachHang() {
        return khachHang;
    }

    /**
     * @param khachHang the khachHang to set
     */
    public void setKhachHang(KhachHang khachHang) {
        this.khachHang = khachHang;
    }

    /**
     * @return the hinhThucThanhToan
     */
    public HinhThucThanhToan getHinhThucThanhToan() {
        return hinhThucThanhToan;
    }

    /**
     * @param hinhThucThanhToan the hinhThucThanhToan to set
     */
    public void setHinhThucThanhToan(HinhThucThanhToan hinhThucThanhToan) {
        this.hinhThucThanhToan = hinhThucThanhToan;
    }

    /**
     * @return the loaiTien
     */
    public LoaiTien getLoaiTien() {
        return loaiTien;
    }

    /**
     * @param loaiTien the loaiTien to set
     */
    public void setLoaiTien(LoaiTien loaiTien) {
        this.loaiTien = loaiTien;
    }

    /**
     * @return the tinhTrang
     */
    public TinhTrangDonHang getTinhTrang() {
        return tinhTrang;
    }

    /**
     * @param tinhTrang the tinhTrang to set
     */
    public void setTinhTrang(TinhTrangDonHang tinhTrang) {
        this.tinhTrang = tinhTrang;
    }

    /**
     * @return the thongTinTuyChon
     */
    public ThongTinTuyChon getThongTinTuyChon() {
        return thongTinTuyChon;
    }

    /**
     * @param thongTinTuyChon the thongTinTuyChon to set
     */
    public void setThongTinTuyChon(ThongTinTuyChon thongTinTuyChon) {
        this.thongTinTuyChon = thongTinTuyChon;
    }

    /**
     * @return the hinhThucVanChuyen
     */
    public HinhThucVanChuyen getHinhThucVanChuyen() {
        return hinhThucVanChuyen;
    }

    /**
     * @param hinhThucVanChuyen the hinhThucVanChuyen to set
     */
    public void setHinhThucVanChuyen(HinhThucVanChuyen hinhThucVanChuyen) {
        this.hinhThucVanChuyen = hinhThucVanChuyen;
    }

    /**
     * @return the thongTinHoaDon
     */
    public ThongTinHoaDon getThongTinHoaDon() {
        return thongTinHoaDon;
    }

    /**
     * @param thongTinHoaDon the thongTinHoaDon to set
     */
    public void setThongTinHoaDon(ThongTinHoaDon thongTinHoaDon) {
        this.thongTinHoaDon = thongTinHoaDon;
    }

    /**
     * @return the danhSachChiTietDonDatHang
     */
    public List<ChiTietDonDatHang> getDanhSachChiTietDonDatHang() {
        return danhSachChiTietDonDatHang;
    }

    /**
     * @param danhSachChiTietDonDatHang the danhSachChiTietDonDatHang to set
     */
    public void setDanhSachChiTietDonDatHang(List<ChiTietDonDatHang> danhSachChiTietDonDatHang) {
        this.danhSachChiTietDonDatHang = danhSachChiTietDonDatHang;
    }

  
}
